import request from '@/utils/request'

// 部门管理分页列表-------------------------------------------------
export function organizeDepartmentList(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgDepartment/pageList',
    method: 'get',
    params: query
  })
}

// 部门新增
export function organizeDepartmentAdd(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgDepartment/add',
    method: 'post',
    data
  })
}

// 部门删除
export function organizeDepartmentDel(query) {
  return request({
    url: '/jbl-user-center/api/admin/v1/sysOrgDepartment/deleteById',
    method: 'get',
    params: query
  })
}

// 部门修改
export function organizeDepartmentEdit(data) {
  return request({
    url: '/jbl-user-center/api/admin/v1/sysOrgDepartment/updateById',
    method: 'post',
    data
  })
}

// --------------------------------------------------------
// 员工管理分页查询
export function organizeEmployeeList(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/pageList',
    method: 'get',
    params: query
  })
}

// 员工新增
export function organizeEmployeeAdd(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/add',
    method: 'post',
    data
  })
}

// 员工删除
export function organizeEmployeeDelete(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/deleteById',
    method: 'get',
    params: query
  })
}

// 员工信息更改
export function organizeEmployeeUpdate(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/updateById',
    method: 'post',
    data
  })
}

// 员工管理 下拉框部门选项
export function organizeAllDepartment(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgDepartment/list',
    method: 'get',
    params: query
  })
}

// 员工管理 职位下拉
export function organizePostionList(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRole/list',
    method: 'get',
    params: query
  })
}

// 员工详情
export function organizeEmployeeDetail(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/getById',
    method: 'get',
    params: query
  })
}

// 禁止员工
export function organizeEmployeeStatus(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/updateStatus',
    method: 'get',
    params: query
  })
}

// 授课年级
export function gradesList(query) {
  return request({
    url: '/jbl-user-center/api/common/v1/getGrade',
    method: 'get',
    params: query
  })
}

// 授课类型
// export function subjectList(query) {
//   return request({
//     url: '/jbl-business/api/mobile/v1/category/getByHomePageMenu',
//     method: 'get',
//     params: query
//   })
// }

// 授课类型(学科)
export function subjectList(query) {
  return request({
    url: '/jbl-business/api/v1/category/getCategoryAll',
    method: 'get',
    params: query
  })
}
// ------------------------------------------------------------------
// 商户端职位分页列表
export function organizePositionLists(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRole/pageList',
    method: 'get',
    params: query
  })
}

// 商户端默认权限列表
export function organizePositionMenuList(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysPermission/cascadeList',
    method: 'get',
    params: query
  })
}

// 职位新增
export function organizePositionAdd(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRole/add',
    method: 'post',
    data
  })
}
// 职位删除
export function organizePositionDelete(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRole/deleteById',
    method: 'get',
    params: query
  })
}
// 职位修改
export function organizePositionEdit(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRole/updateById',
    method: 'post',
    data
  })
}
// 职位id查询
export function organizePositionCheck(query) {
  return request({
    url: '/jbl-user-center/api/merchant/{version}/sysOrgRole/listPermissionById',
    method: 'get',
    params: query
  })
}

// 权限删除
export function organizePositionDel(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRolePermission/deleteBatchByIds',
    method: 'post',
    data
  })
}

// 权限增加
export function organizePositionUpdata(data) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysOrgRolePermission/batchAdd',
    method: 'post',
    data
  })
}

// 员工-验证手机号是否已经存在
export function isRepeatPhoneNum(query){
  return request({
    url:'/jbl-user-center/api/merchant/v1/sysUser/validatePhone',
    method:'get',
    params:query
  })
}

// 部门-验证部门名称是否已经存在
export function isRepeatDepartmentName(query){
  return request({
    url:'/jbl-user-center/api/merchant/v1/sysOrgDepartment/validateDepartName',
    method:'get',
    params:query
  })
}

// 职位-验证职位名称是否已经存在
export function validateRoleName(query){
  return request({
    url:'/jbl-user-center/api/merchant/v1/sysOrgRole/validateRoleName',
    method:'get',
    params:query
  })
}

// 老师推广码
export function QRcode(query) {
  return request({
    url: '/jbl-user-center/api/merchant/v1/sysUser/QRcode',
    method: 'get',
    params: query
  })
}

